package org.lq.his.service.impl;
 
import java.util.List;

import javax.annotation.Resource;

import org.lq.his.dao.PatientDao;
import org.lq.his.pojo.Allergy;
import org.lq.his.pojo.Patient;
import org.lq.his.service.PatientService;
import org.springframework.stereotype.Service;

@Service("patientService")
public class PatientServiceImpl implements PatientService {
	
	@Resource
	private PatientDao patientDao;
	
	public void setPatientDao(PatientDao patientDao) {
		this.patientDao = patientDao;
	}

	//查询所有病人档案
	@Override
	public List<Patient> getAll() {
		
		return patientDao.getAll();
	}

	//分页查询所有病人档案
	@Override
	public List<Patient> getListByCondition(int start, int limit, Patient condition, String column, String orderBy) {
		
		return patientDao.getListByCondition(start, limit, condition, column, orderBy);
	}

	//查询条件
	@Override
	public Integer getCountByCondition(Patient condition) {
		
		return patientDao.getCountByCondition(condition);
	}

	//添加病人档案
	@Override
	public void add(Patient patient) {
		
		patientDao.add(patient);
	}

	//修改病人档案
	@Override
	public void update(Patient patient) {
		
		patientDao.update(patient);
	}

	//根据ID查询病人
	@Override
	public Patient getById(Integer id) {
		
		return patientDao.getById(id);
	}

	//修改病人档案状态
	@Override
	public void bathDeletePatient(Integer[] ids) {
		
		patientDao.deleteByIds(ids);
	}

	

	//减去金额
	@Override
	public Patient editPetientMoney(Integer id, Double money) {

		return patientDao.editPetientMoney(id, money);
	}

}
